<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>Fast Develop Designer</title>
    
    <link rel="stylesheet" href="./compoment/amis/sdk.css" />
    <link rel="stylesheet" href="./compoment/amis/iconfont.css" />
    <link rel="stylesheet" href="./compoment/@ztree/ztree_v3/css/demo.css">
    <link rel="stylesheet" href="./compoment/@ztree/ztree_v3/css/zTreeStyle/zTreeStyle.css">
    <link rel="stylesheet" href="./compoment/layui/dist/css/layui.css">
    <!--jQuery dependencies-->
    <link rel="stylesheet" href="./compoment/jquery-ui/jquery-ui.css" />
    <script src="./compoment/jquery/jquery.min.js"></script>
    <!-- <script src="./compoment/jquery/jquery-1.4.4.min.js"></script> -->
    <script src="./compoment/jquery-ui/jquery-ui.min.js"></script>
    <!--PQ Grid files-->
    <link rel="stylesheet" href="./compoment/jqgrid/pqgrid.min.css" />
    <script src="./compoment/jqgrid/pqgrid.min.js"></script>
    <!--PQ Grid Office theme-->

    <link rel="stylesheet" href="./compoment/jqgrid/themes/bootstrap/pqgrid.css" />
    <link rel="stylesheet" href="./css/all.min.css">

</head>
<body class="">

<div id="app" class="layui-layout layui-layout-admin">

    <div class="content">
        <div class="header">
            <div class="header-left" >
                <div id="header-left"></div>
            </div>
            <div class="header-center">
            </div>
            <div class="header-right">
            </div>
        </div>
    </div>

    <div class="body-content">
        <div class="layui-side" id="editor">
        </div>
    
    
        <div class="layui-body gs-body">
            <div id="fast-body" >
                <ul id="ztree" class="ztree"></ul>
            </div>
    
            <div id="content">
    
            </div>
            <!--<div class="layui-layout-right gs-col-right ">-->
            <!--</div>-->
    
        </div>
    </div>
    



    <!--<div class="layui-footer">-->
        <!--&lt;!&ndash; 底部固定区域 &ndash;&gt;-->
        <!--底部固定区域-->
    <!--</div>-->



</div>
<script src="./compoment/amis/sdk.js"></script>



<script>





    amisRequire('amis');
    var amisObj = amisRequire('amis/embed');
    amisObj.embed("#content",
        {
            "type": "page",
            "title": "规则页面",
            "body": [
                {
                    "type": "form",
                    "title": "",
                    "body": [
                        {
                            "type": "hidden",
                            "name": "designResultName",
                            "value": "测试规则",
                            "id": "u:23927e81011f"
                        },
                        {
                            "type": "hidden",
                            "name": "designResultDesc",
                            "id": "u:57a6baded750",
                            "value": "测试规则"
                        },
                        {
                            "name": "rules",
                            "label": "",
                            "type": "combo",
                            "multiple": true,
                            "multiLine": true,
                            "items": [
                                {
                                    "label": "规则名称",
                                    "name": "ruleName",
                                    "id": "u:43c90a1b04d6",
                                    "type": "input-text",
                                    "size": "lg",
                                    "placeholder": "请录入规则名称"
                                },
                                {
                                    "label": "执行条件",
                                    "name": "when",
                                    "id": "u:521b8114c9ef",
                                    "$ref": "queryGroup",
                                    "value": {
                                    }
                                },
                                {
                                    "type": "textarea",
                                    "label": "执行内容",
                                    "name": "then",
                                    "id": "u:e3d1be39c4cc",
                                    "minRows": 3,
                                    "maxRows": 20,
                                    "placeholder": "请录入需要执行的函数"
                                }
                            ],
                            "addButtonText": "添加规则",
                            "id": "u:6c3511058cd8",
                            "placeholder": "请添加规则",
                            "required": true
                        }
                    ],
                    "id": "u:6aeeab144d5b",
                    "api": "{contextPath}/api/v1/engine/brms/designer/saveDesign"
                }
            ],
            "id": "u:780f2625a51a",
            "className": "rounded-xl h-auto",
            "headerClassName": "p-b-none",
            "definitions": {
                "queryItem": {
                    "type": "combo",
                    "multiple": true,
                    "multiLine": true,
                    "typeSwitchable": false,
                    "conditions": [
                        {
                            "label": "条件",
                            "test": "!data.hasOwnProperty('connect')",
                            "scaffold": {
                            },
                            "items": [
                                {
                                    "type": "group",
                                    "className": "m-b-none",
                                    "body": [
                                        {
                                            "name": "left",
                                            "type": "nested-select",
                                            "source": "{contextPath}/api/v1/engine/brms/designer/options/1234",
                                            "onlyLeaf": true,
                                            "mode": "inline",
                                            "size": "md"
                                        },
                                        {
                                            "type": "input-text",
                                            "name": "formula",
                                            "placeholder": "请录入条件表达式",
                                            "visibleOn": "~this.left.indexOf('&forluma')",
                                            "mode": "inline",
                                            "size": "lg"
                                        },
                                        {
                                            "name": "opt",
                                            "type": "select",
                                            "placeholder": "请选择",
                                            "required": true,
                                            "options": [
                                                {
                                                    "label": ">",
                                                    "value": ">",
                                                    "visibleOn": "~this.left.indexOf('')"
                                                },
                                                {
                                                    "label": "<",
                                                    "value": "<",
                                                    "visibleOn": "~[0,1,3].indexOf(this.type)"
                                                },
                                                {
                                                    "label": "==",
                                                    "value": "=="
                                                },
                                                {
                                                    "label": ">=",
                                                    "value": ">=",
                                                    "visibleOn": "~[0,1,3].indexOf(this.type)"
                                                },
                                                {
                                                    "label": "<=",
                                                    "value": "<=",
                                                    "visibleOn": "~[0,1,3].indexOf(this.type)"
                                                },
                                                {
                                                    "label": "in",
                                                    "value": "in"
                                                },
                                                {
                                                    "label": "not in",
                                                    "value": "not in"
                                                },
                                                {
                                                    "label": "!=",
                                                    "value": "!="
                                                }
                                            ],
                                            "visibleOn": "~this.left.indexOf('&fact')|~this.left.indexOf('&variable')",
                                            "mode": "inline",
                                            "size": "sm"
                                        },
                                        {
                                            "name": "val",
                                            "type": "input-text",
                                            "placeholder": "值",
                                            "required": true,
                                            "visibleOn": "~[\">\", \"<\", \">=\", \"<=\", \"==\", \"!=\"].indexOf(this.opt)&(~this.left.indexOf('&fact')|~this.left.indexOf('&variable'))",
                                            "mode": "inline",
                                            "size": "lg"
                                        }
                                    ]
                                }
                            ]
                        },
                        {
                            "label": "条件组",
                            "test": "data.hasOwnProperty('connect')",
                            "scaffold": {
                                "connect": "and",
                                "exprs": [
                                    {
                                    }
                                ]
                            },
                            "items": [
                                {
                                    "type": "button-group-select",
                                    "name": "connect",
                                    "value": "and",
                                    "clearable": false,
                                    "size": "xs",
                                    "options": [
                                        {
                                            "label": "并且",
                                            "value": "and"
                                        },
                                        {
                                            "label": "或者",
                                            "value": "or"
                                        }
                                    ]
                                },
                                {
                                    "$ref": "queryItem",
                                    "name": "exprs",
                                    "minLength": 1,
                                    "value": [
                                        {
                                        }
                                    ]
                                }
                            ]
                        }
                    ],
                    "id": "u:17060539eb20",
                    "addButtonText": "添加条件",
                    "messages": {
                    }
                },
                "queryGroup": {
                    "type": "combo",
                    "multiple": false,
                    "multiLine": true,
                    "items": [
                        {
                            "type": "button-group-select",
                            "name": "connect",
                            "value": "and",
                            "clearable": false,
                            "size": "sm",
                            "options": [
                                {
                                    "label": "并且",
                                    "value": "and"
                                },
                                {
                                    "label": "或者",
                                    "value": "or"
                                }
                            ]
                        },
                        {
                            "$ref": "queryItem",
                            "name": "exprs",
                            "minLength": 1,
                            "value": [
                                {
                                }
                            ]
                        }
                    ],
                    "id": "u:84438df75b38",
                    "name": "when"
                }
            },
            "regions": [
                "body",
                "header"
            ]
        });



</script>

</body>
</html>